<?php
/**
 * Created by PhpStorm.
 * User: MI
 * Date: 2019/3/6
 * Time: 14:20
 */

namespace App\Http\Controllers\Api;


use App\Http\Controllers\Controller;
use App\Models\Permission;
use App\Models\Role;
use App\Http\Resources\SelectorResource;

class DataProviderController extends Controller
{
    /**
     * 全部权限
     * @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection
     */
    public function getPermission()
    {
        $models = Permission::query()->get();
        return SelectorResource::collection($models);
    }

    /**
     * 全部角色
     * @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection
     */
    public function getRole()
    {
        $models = Role::query()->get();
        return SelectorResource::collection($models);
    }
}
